/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoopp.framework;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class MD5 {
    public static final String TAG = "MD5";

    public static String getMD5(String paramString) {
        try {
            LogUtil.d("MD5", paramString);
            MessageDigest localMessageDigest;
            (localMessageDigest = MessageDigest.getInstance("MD5")).reset();
            localMessageDigest.update(paramString.getBytes());
            return HexEncode(localMessageDigest.digest());
        } catch (NoSuchAlgorithmException localNoSuchAlgorithmException) {
            localNoSuchAlgorithmException.printStackTrace();
        }
        return "";
    }

    public static String HexEncode(byte[] paramArrayOfByte) {
        StringBuilder localStringBuilder = new StringBuilder(paramArrayOfByte.length * 2);
        for (int k : paramArrayOfByte) {
            localStringBuilder.append(Integer.toHexString((k & 0xF0) >>> 4));
            localStringBuilder.append(Integer.toHexString(k & 0xF));
        }
        return localStringBuilder.toString();
    }
}